﻿@inherits System.Web.Mvc.WebViewPage<IEnumerable<Pikapika.Models.Novel>>

@{
    ViewBag.Title = "Novel - List";
    
}

    <table>
        <tr>
            <th></th>
            <th>
                Id
            </th>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
                PublisherId
            </th>
            <th>
                Author
            </th>
            <th>
                ImageUrl
            </th>
            <th>
                RatingPoints
            </th>
            <th>
                RatingCount
            </th>
            <th>
                UpdatedDate
            </th>
        </tr>

    @foreach (var item in Model) {
    
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.Id }) |
                @Html.ActionLink("Volumes", "Index", "NovelVolume", new { novelId=item.Id }, null)
            </td>
            <td>
                @item.Id
            </td>
            <td>
                @item.Name
            </td>
            <td>
                @item.Description.AutoEllipsis(20)
            </td>
            <td>
                @item.PublisherId ( @item.Publisher.Name )
            </td>
            <td>
                @item.Author
            </td>
            <td>
                @item.ImageUrl
            </td>
            <td>
                @item.RatingPoints
            </td>
            <td>
                @item.RatingCount
            </td>
            <td>
                @String.Format("{0:g}", item.UpdatedDate)
            </td>
        </tr>
    
    }

    </table>

    <p>
        @Html.ActionLink("Create New", "Create", new { publisherId = ViewBag.PublisherId }) | 
        @Html.ActionLink("Back to publishers", "Index", "Publisher")
    </p>


